import 'package:flutter/material.dart';
import 'package:hook_up_rent/pages/room_add/room_add.dart';
import 'package:hook_up_rent/widgets/common_picker.dart';

class CommonFormSelect extends StatelessWidget {
  final String label;
  final int value;
  final List<String> options;
  final Function(int) onChange;

  const CommonFormSelect(
      {Key key, this.label, this.value, this.options, this.onChange})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 40.0,
      padding: EdgeInsets.only(left: commonPadding, right: commonPadding),
      decoration: BoxDecoration(
          border: Border(
              bottom: BorderSide(
                  width: 1.0, color: Theme.of(context).dividerColor))),
      child: Row(
        children: [
          Container(
            width: 100.0,
            child: Text(
              label,
              style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
            ),
          ),
          Expanded(
              child: GestureDetector(
                behavior: HitTestBehavior.opaque,
            onTap: () {
              CommonPicker.showPicker(
                  context: context, options: options, value: 0);
            },
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(options[value]),
                Icon(Icons.keyboard_arrow_right)
              ],
            ),
          )),
        ],
      ),
    );
  }
}
